package com.metadata_system.common.db.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

@Data
@Table(name = "md_user_login_log")
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class UserLoginLog {
    @Id
    private Integer id;

    /**
     * 设别ID
     */
    @Column(name = "device_id")
    private String deviceId;

    /**
     * 用户ID
     */
    @Column(name = "user_id")
    private Integer userId;

    /**
     * 用户角色
     */
    private String role;

    /**
     * 用户名
     */
    private String username;

    /**
     * 操作IP
     */
    private String ip;

    /**
     * 状态
     */
    private Integer status;


    /**
     * 操作时间
     */
    @Column(name = "created_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createdTime;
}
